Getting and Setting Storage Object Information
QuickDraw 3D provides routines that you can use to get or set some of the information it maintains about storage objects. For example, you can get the file reference number of the Macintosh file associated with a Macintosh storage object by calling the function
Q3MacintoshStorage_Get
. Similarly, you can determine the starting address and size of a buffer associated with a memory storage object by calling
Q3MemoryStorage_GetBuffer
.
In general, the routines that get and set storage object information operate like the get and set routines for other types of QuickDraw 3D objects, but with several important differences:
-
For memory storage objects created by a call to
Q3MemoryStorage_NewBuffer
, the returned address is the address of the actual buffer associated with the storage object,
not
the address of a copy of that buffer. In addition, that buffer may change locations in memory (but only if QuickDraw 3D allocated the buffer on your behalf and writing data to the storage object causes QuickDraw 3D to resize the buffer).
-
You cannot access subclass data using the get and set methods of a class. For example, you cannot use
Q3MemoryStorage_Get
or
Q3MemoryStorage_Set
with a handle storage object (of type
kQ3MemoryStorageTypeHandle
). Similarly, you cannot use
Q3UnixStorage_Get
or
Q3UnixStorage_Set
with a UNIX path name storage object (of type
kQ3UnixStorageTypePath
).
-
You cannot use the get or set methods with a storage object that is open. A storage object is considered
open
whenever its associated storage is in use--for example, when an application is reading data from a file object attached to the storage object. (To be more specific, a storage object is open if it has been attached to a file object by a call to the
Q3File_SetStorage
function and that file object has been opened by a call to the
Q3File_OpenRead
or
Q3File_OpenWrite
function.) A storage object is considered
closed
at all other times. (Note that a storage object can be closed even though the associated file on disk is open to the operating system.)
© 1997 Apple Computer, Inc.Previous | QD3D Book | Overview | Chapter Contents | Next